
<?php session_start();

 if (empty($_SESSION['nombre']))
	echo "<meta http-equiv='Refresh' content='0;url=../index.php'>";

require '../../config.php';

function _convert($content) {
		if(!mb_check_encoding($content, 'UTF-8')
		OR !($content === mb_convert_encoding(mb_convert_encoding($content, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) {
	
			$content = mb_convert_encoding($content, 'UTF-8');
	
			if (mb_check_encoding($content, 'UTF-8')) {
				// log('Converted to UTF-8');
			} else {
				// log('Could not converted to UTF-8');
			}
		}
		return $content;
	} 
?>
<!DOCTYPE html>
<head>
<title>Formulario de Pago</title>
<meta charset="utf-8">
    <!-- <title>Seguimiento de clientes</title>
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
   	<link href="../bootstrap/css/view.css" rel="stylesheet">
   	<link href="../bootstrap/css/cupertino/jquery.ui.all.css" rel="stylesheet" type="text/css">
   	
	<script type="text/javascript" src="../bootstrap/scripts/view.js"></script>
	<script type="text/javascript" src="../bootstrap/scripts/jquery.js"></script> 
	<script type="text/javascript" src="../bootstrap/js/bootstrap.min.js"></script> 
	<script type="text/javascript" src="../bootstrap/js/jquery.ui.core.min.js"></script>
	<script type="text/javascript" src="../bootstrap/js/jquery.ui.datepicker.min.js"></script>    
	<script type="text/javascript" src="../bootstrap/js/toastr.min.js"></script> 
    <link href="../bootstrap/css/toastr.min.css" rel="stylesheet"> -->
</head>
<script type="text/javascript">
		 $(document).ready(function()
		{
		   var jQueryDatePicker1Opts =
		   {
		      dateFormat: 'yy-mm-dd',
		      changeMonth: false,
		      changeYear: false,
		      showButtonPanel: false,
		      showAnim: 'show'
		   };
		   $("#fechaprox222").datepicker(jQueryDatePicker1Opts);
		   $("#fecha222").datepicker(jQueryDatePicker1Opts);
		  
		}); 
</script>
<body  >
	<div  >
		<h1><a style="background-color: #00f"></a></h1>
		
		<form  >
					
			<datalist id="lstclientes">
			<?php
				$registros=mysql_query("select nombre from  clientesventas where tipo=3 and activo=1");
					
																			
			  while ($row = mysql_fetch_array($registros))
						{
			?> <option value="<?php echo $row['nombre'];?>"> <?php
				}
				?>
		
			</datalist>	 			
			<ul >
		
			
		<li  >
		<label class="description" for="nombrecliente">Nombre de cliente o empresa: </label>
		<div>
			<input id="nombrecliente" list="lstclientes" name="element_44d" class="element text medium" type="text" maxlength="30" size="30">&nbsp;<input type="button" value="Buscar Datos del Cliente" class="btn btn-default btn-xs" onclick="traerDatosCli2();"></input>
		</div> 
		</li>
		<li>
		<div id="datoscli"></div>
		</li>
		<li>
		
		</li>
		<li  ><legend>Descripci&oacute;n del Contrato:</legend>
			
		</li>
			<li>
			<div id="desccont">
			
			</div>
			</li>
			<li>
			<?php 
			echo 	"<div>";
			echo 	"<label class='description' for='profesionver'>Monto a Pagar: </label>";
			echo 	"<input id='monto222' required type='text'  size='10' onkeyUp='return ValNumero(this);'>";
			echo 	"</div>";
			?>
			</li>
			
			<li><div>
			
			<label class="description" for="element_722">Pr&oacute;xima Fecha de Pago: </label>
			<input id="fechaprox222" name="element_722" title="Opcional" class="element text medium" maxlength="250" value="" type="text">
		</div>
			</li>
			<li><div>
			
			<label class="description" for="element_722">Observaci&oacute;n: </label>
			<input id="obs222" name="element_722" title="Opcional" class="element text medium" maxlength="250" value="" type="text">
		</div>
			</li>										
<!-- 		<legend></legend> -->
<!-- 		<li class="buttons"> -->
<!--		<input id="enviar" class="btn btn-success" type="button"  value="Registrar Pago" onclick="registarPago();" />
<!--		<input id="cancelar" class="btn btn-warning" type="button" name="cancelar" value="Cancelar" onclick="window.history.back(1)" />
<!-- 		</li> -->
			</ul>
		</form>	
		
	</div>
   
</body>
	
<script type="text/javascript">
 function crearXMLHttpRequest2() 
{
  var xmlHttp=null;
  if (window.ActiveXObject) 
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  else 
    if (window.XMLHttpRequest) 
      xmlHttp = new XMLHttpRequest();
  return xmlHttp;
}

var conexhttp2;



function traerDatosCli2()
{
		
	  var nombrecliente2 = $('#nombrecliente').val().toString();
		
		
		if(nombrecliente2=="")
			{
			document.getElementById('datoscli').innerHTML = "Nombre Vacio.";
			return false;
			}
		
	
	conexhttp2=crearXMLHttpRequest2();
	conexhttp2.onreadystatechange = presentarTabla;
	conexhttp2.open('GET',"../traerdatoscli.php?nombrecliente="+nombrecliente2, true);
	conexhttp2.send(null);
}
function presentarTabla()
{
  if(conexhttp2.readyState == 4)
  document.getElementById('datoscli').innerHTML = conexhttp2.responseText;
  else 
	  document.getElementById('datoscli').innerHTML = "<strong>Cargando datos, por favor espere...</strong><br>"+$taghtml2;
}
$taghtml2 = "<div class='progress progress-striped active'><div class='progress-bar'  role='progressbar' aria-valuenow='50' aria-valuemin='0' aria-valuemax='50' style='width: 100%'>";
$taghtml2 +=  "<div class='progress-bar'  role='progressbar' aria-valuenow='50' aria-valuemin='0' aria-valuemax='50' style='width: 100%'></div></div>";
 function cambiarContrato()
{
	try {
		alertar("Buscando Datos, Por Favor Espere..","info");
		codigocontrato = document.getElementById('conts').value;
		$('#desccont').load('../datadetallescontarto.php?idcontrato='+codigocontrato);
	} catch (err) {
		alertar("Error JS= " + err.message, "error");
	}
} 
function Solo_Numero(obj)
{
  Numero=obj;
  if (isNaN(Numero))
	  {
            return "";
      }
   return Numero;
 }
function ValNumero(Control)
{
    Control.value=Solo_Numero(Control.value);
} 
alertar("Datos cargados","info");
</script>

</html>
